
#include "ti_msp_dl_config.h"
#include "hardware/uart.h"

void InitUART()
{
    // 清除串口中断标志
    NVIC_ClearPendingIRQ(UART_CONSOLE_INST_INT_IRQN);
    // 使能串口中断
    NVIC_EnableIRQ(UART_CONSOLE_INST_INT_IRQN);
}

void UART0SendChar(char c)
{
    while (DL_UART_isBusy(UART_CONSOLE_INST) == true)
    ;
    DL_UART_Main_transmitData(UART_CONSOLE_INST, c);
}

void UART0SendString(char *str)
{
    if (str == NULL)
        return;
    
    while (*str != 0)
    {
        UART0SendChar(*str);
        ++str;
    }
}